<template>
  <f7-page>
    <f7-navbar title="提交记录" back-link="返回"></f7-navbar>

    <f7-row class="table-title text-align-center">
      <f7-col>标题</f7-col>
      <f7-col>时间</f7-col>
      <f7-col>状态</f7-col>
      <f7-col>操作</f7-col>
    </f7-row>
    <f7-row class="table-title text-align-center" v-for="(item, index) in record" :key="index">
      <f7-col>{{item.title}}</f7-col>
      <f7-col>{{$moment(item.add_time * 1000).format('YYYY-MM-DD')}}</f7-col>
      <f7-col>{{item.status | statusFilter}}</f7-col>
      <f7-col>
        <f7-button class="small" fill :href="`/service-chat/?id=${item.id}`">查看回复</f7-button>
      </f7-col>
    </f7-row>
  </f7-page>
</template>

<script>
  import { serviceQueRecord } from "../api/my";
  import service from "../utils/request";

  export default {
    name: "service-record",
    data() {
      return {
        record: []
      }
    },
    filters: {
      statusFilter(status) {
        return status === '1' ? '未回复' : status === '2' ? '已回复' : '已查看';
      }
    },
    mounted() {
      this.init();
    },
    methods: {
      init() {
        serviceQueRecord().then(res => {
          this.record = res.data;
        })
      }
    }
  }
</script>

<style scoped>

</style>